package org.caro.gui;

import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.EmptyBorder;

import org.caro.actions.ContestantAction;

public class MainGame extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JPanel contentPane;
        private UtilityZonePanel utilityZone;
        private ActionZonePanel actionZone;
        private ChatZonePanel chatZone;

	/**
	 * Launch the application.
	 */
	
	/**
	 * Create the frame.
	 * @throws Exception 
	 * @throws UnsupportedLookAndFeelException 
	 * @throws IllegalAccessException 
	 * @throws InstantiationException 
	 * @throws ClassNotFoundException 
	 */
	public MainGame(int mode,ContestantAction contestant) throws Exception {
            try {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName().toString());
            } catch (Exception ex) {  }
            
           
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
               
		setBounds(100, 100, 1000, 757);
                contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(10, 10, 5, 10));
		setContentPane(contentPane);
		
		utilityZone = new UtilityZonePanel(mode,contestant);
		actionZone = new ActionZonePanel(mode,utilityZone,contestant);                              
		chatZone = new ChatZonePanel(mode,contestant);    
		
                contentPane.setLayout(new BorderLayout());
                contentPane.add(actionZone,BorderLayout.CENTER);
                contentPane.add(chatZone,BorderLayout.EAST);
                contentPane.add(utilityZone,BorderLayout.NORTH);
                setLocationRelativeTo(null);
                setVisible(true);

                
	}

    public UtilityZonePanel getUtilityZone() {
        return utilityZone;
    }

    public ActionZonePanel getActionZone() {
        return actionZone;
    }

    public ChatZonePanel getChatZone() {
        return chatZone;
    }
    
}
